package com.petsystem.service.impl;

import com.petsystem.dao.PetDAO;
import com.petsystem.dao.impl.PetDAOImpl;
import com.petsystem.service.PetService;
import com.petsystem.vo.Pet;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * 宠物模块的Service层（业务层）的具体实现类，对PetService接口中定义的抽象方法作出具体的功能实现
 */
public class PetServiceImpl implements PetService {
    @Override
    public void add(Pet vo) {
        PetDAO petDAO = new PetDAOImpl();
        petDAO.add(vo);
    }

    @Override
    public void delete(long id) {
        PetDAO petDAO = new PetDAOImpl();
        petDAO.delete(id);
    }

    @Override
    public void update(Pet vo) {
        PetDAO petDAO = new PetDAOImpl();
        petDAO.update(vo);
    }

    @Override
    public Pet get(Serializable id) {
        PetDAO petDAO = new PetDAOImpl();
        return petDAO.get(id);
    }

    @Override
    public List<Pet> list(Map<String, Object> params) {
        PetDAO petDAO = new PetDAOImpl();
        return petDAO.list(params);
    }
}